<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
          let mypromise= new Promise(function(res,rej){
           console.log('promise代码执行')
            let asd = 10;
           //rej("失败回调")
           res(asd)
        })
        let P=mypromise.then((data)=>{
            console.log('成功',data )
        },(err)=>{
            console.log('错误',err)
        }
    )
        P.then(()=>{
            console.log('成功')
        })
    </script>
</body>
</html>